<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>dom对象和自定义对象是一样的</title>
</head>
<body>
    <h2>hdms</h2>
    <script>
        const h2 = document.querySelector('h2');
        Object.assign(h2,{
            innerHTML: '后盾人',
            color: 'red',
            onclick(){
                this.style.color = this.color;
            }
        });
        Object.assign(h2.style,{
            fontSize:'50px',
            color: 'blue',
            border: '10px solid #ddd'
        })
    </script>
</body>
</html>